package com.gu.mapper;

import com.gu.entity.UserDO;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * 由于需要对分页支持,请直接使用对应的DAO类
 * The Table gu_user.
 * 系统用户表
 */
public interface UserMapper{

    /**
     * desc:插入表:gu_user.<br/>
     * descSql =  SELECT LAST_INSERT_ID() <![CDATA[ INSERT INTO gu_user( ID ,USER_NAME ,USER_NICKNAME ,SYSTEM_PASSWORD ,STATUS ,USER_PHONE ,OCCUPATION_TYPE ,BIRTHDAY ,CREATE_TIME ,UPDATE_TIME )VALUES( null , #{userName,jdbcType=VARCHAR} , #{userNickname,jdbcType=VARCHAR} , #{systemPassword,jdbcType=VARCHAR} , #{status,jdbcType=INTEGER} , #{userPhone,jdbcType=INTEGER} , #{occupationType,jdbcType=INTEGER} , #{birthday,jdbcType=DATE} , #{createTime,jdbcType=DATE} , #{updateTime,jdbcType=DATE} ) ]]>
     * @param entity entity
     * @return Integer
     */
    Integer insert(UserDO entity);
    /**
     * desc:根据主键删除数据:gu_user.<br/>
     * descSql =  <![CDATA[ DELETE FROM gu_user WHERE ID = #{id,jdbcType=INTEGER} ]]>
     * @param id id
     * @return Integer
     */
    Integer deleteUserById(Integer id);
    /**
     * desc:根据主键获取数据:gu_user.<br/>
     * descSql =  SELECT * FROM gu_user WHERE <![CDATA[ ID = #{id,jdbcType=INTEGER} ]]>
     * @param id id
     * @return UserDO
     */
    UserDO getById(Integer id);

    List<UserDO> userList(String selectUserParam);

    Integer updateUserStatus(@Param("status") Integer status,@Param("id") Integer id);

    UserDO selectUserByUserPhone(@Param("userPhone") String userPhone);

    UserDO selectUserByIdCard(@Param("idCard") String idCard,@Param("userName") String userName);

     int updateUserPassword(@Param("systemPassword") String systemPassword,@Param("id") Integer id);


     int forgetUserPassword(@Param("systemPassword") String systemPassword,@Param("userPhone") String userPhone);

    /**
     * 更新用户封禁原因
     * @param banReason
     * @param id
     * @return
     */
     int updateUserBanReason(@Param("banReason") String banReason,@Param("id") Integer id);

    /**
     * 动态全更新
     * @param userDO
     * @return
     */
     int updateAllUserInfo(UserDO userDO);

    List<UserDO> getAllUser();


}
